<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: bg0rom.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12cda917fe1d7c8b4e7d2501bb3636e4.html">sdk</a></li><li class="navelem"><a class="el" href="dir_2f23e30b638d6a5f333babd9a5d183e1.html">include</a></li><li class="navelem"><a class="el" href="dir_d5ace589187da7c83c1a7507ec9fbbef.html">sifteo</a></li><li class="navelem"><a class="el" href="dir_483499650334b406c1d3bbaf3a730f60.html">video</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">bg0rom.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * This file is part of the public interface to the Sifteo SDK.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright &lt;c&gt; 2012 Sifteo, Inc. All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef NOT_USERSPACE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#   error This is a userspace-only header, not allowed by the current build.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sifteo/abi.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;sifteo/macros.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;sifteo/math.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">namespace </span>Sifteo {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html">   34</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html" title="A VRAM accessor for drawing graphics in the BG0_ROM mode.">BG0ROMDrawable</a> {</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    _SYSAttachedVideoBuffer sys;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ada13ca0ac5108834ce02bd3956e956d4">   40</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ada13ca0ac5108834ce02bd3956e956d4" title="Palette IDs, XOR&#39;ed with the tile IDs below.">Palette</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        BLACK_ON_WHITE      = 0 &lt;&lt; 10,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        BLUE_ON_WHITE       = 1 &lt;&lt; 10,</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        ORANGE_ON_WHITE     = 2 &lt;&lt; 10,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        YELLOW_ON_BLUE      = 3 &lt;&lt; 10,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        RED_ON_WHITE        = 4 &lt;&lt; 10,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        GRAY_ON_WHITE       = 5 &lt;&lt; 10,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        WHITE_ON_BLACK      = 6 &lt;&lt; 10,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        WHITE_ON_BLUE       = 7 &lt;&lt; 10,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        WHITE_ON_TEAL       = 8 &lt;&lt; 10,</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        BLACK_ON_YELLOW     = 9 &lt;&lt; 10,</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        DKGRAY_ON_LTGRAY    = 10 &lt;&lt; 10,</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        GREEN_ON_WHITE      = 11 &lt;&lt; 10,</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        WHITE_ON_GREEN      = 12 &lt;&lt; 10,</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        PURPLE_ON_WHITE     = 13 &lt;&lt; 10,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        LTBLUE_ON_DKBLUE    = 14 &lt;&lt; 10,</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        GOLD_ON_WHITE       = 15 &lt;&lt; 10,</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="comment">// Aliases for white background</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        BLACK   = BLACK_ON_WHITE,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        BLUE    = BLUE_ON_WHITE,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        ORANGE  = ORANGE_ON_WHITE,</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        RED     = RED_ON_WHITE,</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        GRAY    = GRAY_ON_WHITE,</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        GREEN   = GREEN_ON_WHITE,</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        PURPLE  = PURPLE_ON_WHITE,</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        GOLD    = GOLD_ON_WHITE,</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    };</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468ef">   72</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468ef" title="Well-known tile numbers.">Tiles</a> {</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa8bb53f4719b57f3c4de9fef4884fc13f">   73</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa8bb53f4719b57f3c4de9fef4884fc13f" title="First character in the font, ASCII space.">FONT_SPACE</a>  = 0,        </div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa884b5cad289e4e65e94ea3d6c076564f">   74</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa884b5cad289e4e65e94ea3d6c076564f" title="Solid background-colored tile (space)">SOLID_BG</a>    = 0,        </div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa77a182f493e1a37e27494dce9b016df1">   75</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa77a182f493e1a37e27494dce9b016df1" title="Solid foreground-colored tile.">SOLID_FG</a>    = 104,      </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efac4867a3d2c025af377e92fa46ec69357">   76</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efac4867a3d2c025af377e92fa46ec69357" title="First tile in the vertical bargraph series.">V_BARGRAPH</a>  = 224,      </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa89635bc9e1e5e10497369c80468c1998">   77</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa89635bc9e1e5e10497369c80468c1998" title="First tile in the horizontal bargraph series.">H_BARGRAPH</a>  = 231,      </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    };</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1654819d4b26ba0733269c49e9d1c123">   83</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1654819d4b26ba0733269c49e9d1c123" title="Color modes, XOR&#39;ed with the tile IDs below.">ColorMode</a> {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        TWO_COLOR   = 0 &lt;&lt; 9,</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        FOUR_COLOR  = 1 &lt;&lt; 9,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    };</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874">   91</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordflow">return</span> _SYS_VRAM_BG0_WIDTH;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5">   98</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>() {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <span class="keywordflow">return</span> _SYS_VRAM_BG0_WIDTH;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a179d01b657e7de2984b9d1ff79b447f0">  105</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a179d01b657e7de2984b9d1ff79b447f0" title="Return the size of this mode as a vector, in tiles.">tileSize</a>() {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>(), <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a2cd26883932767e425ec0b53eeccde6d">  112</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a2cd26883932767e425ec0b53eeccde6d" title="Return the width, in pixels, of this mode.">pixelWidth</a>() {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() * 8;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    }</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1f081d71f83e30d822bdc34b4092f040">  119</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1f081d71f83e30d822bdc34b4092f040" title="Return the height, in pixel, of this mode.">pixelHeight</a>() {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>() * 8;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    }</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#af821801766a8181551e69d521f7843a3">  126</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#af821801766a8181551e69d521f7843a3" title="Return the size of this mode as a vector, in pixels.">pixelSize</a>() {</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a2cd26883932767e425ec0b53eeccde6d" title="Return the width, in pixels, of this mode.">pixelWidth</a>(), <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1f081d71f83e30d822bdc34b4092f040" title="Return the height, in pixel, of this mode.">pixelHeight</a>());</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a988fed2cf0c23900cb0bedaa55ea5f38">  133</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a988fed2cf0c23900cb0bedaa55ea5f38" title="Returns the size of this drawable&#39;s tile data, in bytes.">sizeInBytes</a>() {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() * <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>() * 2;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a66b61208a0fb39bd21329c20fb477eba">  140</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a66b61208a0fb39bd21329c20fb477eba" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>() {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() * <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>();</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea">  149</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos) {</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <span class="keywordflow">return</span> pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> * <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>();</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    }</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ae3532b526f471b521e78d4fff0cf82d5">  157</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ae3532b526f471b521e78d4fff0cf82d5" title="Erase mode-specific VRAM, filling the BG0 buffer with the specified value and resetting the panning r...">erase</a>(uint16_t index = 0) {</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, 0, _SYS_TILE77(index), <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a66b61208a0fb39bd21329c20fb477eba" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>());</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac622307cec20b9d778f8616bcf29a83e" title="Change the hardware pixel-panning origin for this mode.">setPanning</a>(<a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(0,0));</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    }</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac622307cec20b9d778f8616bcf29a83e">  170</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac622307cec20b9d778f8616bcf29a83e" title="Change the hardware pixel-panning origin for this mode.">setPanning</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> pixels) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        _SYS_vbuf_poke(&amp;sys.vbuf, <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg0_x) / 2,</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            <a class="code" href="group__math.html#gacd70c1d896652ae6cd08793202b929bf" title="Compute the unsigned remainder from dividing two signed integers.">umod</a>(pixels.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a2cd26883932767e425ec0b53eeccde6d" title="Return the width, in pixels, of this mode.">pixelWidth</a>()) |</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            (<a class="code" href="group__math.html#gacd70c1d896652ae6cd08793202b929bf" title="Compute the unsigned remainder from dividing two signed integers.">umod</a>(pixels.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>, <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1f081d71f83e30d822bdc34b4092f040" title="Return the height, in pixel, of this mode.">pixelHeight</a>()) &lt;&lt; 8));</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    }</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#af8bf59b97d0bafffb52851ed0f7cd3d5">  180</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#af8bf59b97d0bafffb52851ed0f7cd3d5" title="Retrieve the last value set by setPanning(), modulo the layer size in pixels.">getPanning</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordtype">unsigned</span> word = _SYS_vbuf_peek(&amp;sys.vbuf, <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg0_x) / 2);</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        <span class="keywordflow">return</span> vec&lt;int&gt;(word &amp; 0xFF, word &gt;&gt; 8);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    }</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a0d3e6d2ad6fff5d0876d7d3a03f4887f">  188</a></span>&#160;    <span class="keyword">static</span> uint16_t <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a0d3e6d2ad6fff5d0876d7d3a03f4887f" title="Calculate the tile index of one character in the ROM font.">charTile</a>(<span class="keywordtype">char</span> c, <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ada13ca0ac5108834ce02bd3956e956d4" title="Palette IDs, XOR&#39;ed with the tile IDs below.">Palette</a> palette = BLACK) {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="keywordflow">return</span> palette ^ (c - <span class="charliteral">&#39; &#39;</span> + <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa8bb53f4719b57f3c4de9fef4884fc13f" title="First character in the font, ASCII space.">FONT_SPACE</a>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a6579076bcbda035a15f119a4c9fb7651">  197</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a6579076bcbda035a15f119a4c9fb7651" title="Plot a single tile, at location &#39;pos&#39;, in tile units.">plot</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, uint16_t tileIndex) {</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        _SYS_vbuf_poke(&amp;sys.vbuf, <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos), _SYS_TILE77(tileIndex));</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    }</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aa21f7f40e1b00a6b427ec66b9fdd44c2">  208</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aa21f7f40e1b00a6b427ec66b9fdd44c2" title="Plot a horizontal span of tiles, given the position of the leftmost tile, and the number of tiles to ...">span</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> width, <span class="keywordtype">unsigned</span> tileIndex)</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    {</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt;= <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; width &lt;= <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;            (pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + width) &lt;= <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos), _SYS_TILE77(tileIndex), width);</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    }</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a5ebe3bee2c3844617deb7d50feecdb15">  221</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a5ebe3bee2c3844617deb7d50feecdb15" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keywordtype">unsigned</span> tileIndex)</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    {</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        <span class="keywordflow">while</span> (size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>) {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;            <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aa21f7f40e1b00a6b427ec66b9fdd44c2" title="Plot a horizontal span of tiles, given the position of the leftmost tile, and the number of tiles to ...">span</a>(topLeft, size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, tileIndex);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>--;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;            topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>++;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        }</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ad8859d8ae416c0a4dd20c6251d36db81">  238</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ad8859d8ae416c0a4dd20c6251d36db81" title="Draw a horizontal bargraph, with its top-left corner position specified in tiles, and its width in pi...">hBargraph</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> topLeft, <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a2cd26883932767e425ec0b53eeccde6d" title="Return the width, in pixels, of this mode.">pixelWidth</a>,</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ada13ca0ac5108834ce02bd3956e956d4" title="Palette IDs, XOR&#39;ed with the tile IDs below.">Palette</a> palette = BLACK, <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a> = 1)</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    {</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keywordtype">unsigned</span> addr = <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(topLeft);</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        <span class="keywordtype">int</span> wTiles = pixelWidth / 8;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        <span class="keywordtype">int</span> wRemainder = pixelWidth % 8;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        <span class="keywordflow">while</span> (<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#aae5a14cd1c101de1d888e270b6328cf5" title="Return the height, in tiles, of this mode.">tileHeight</a>--) {</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;            _SYS_vbuf_fill(&amp;sys.vbuf, addr,</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;                _SYS_TILE77(palette ^ <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa77a182f493e1a37e27494dce9b016df1" title="Solid foreground-colored tile.">SOLID_FG</a>), wTiles);</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            <span class="keywordflow">if</span> (wRemainder)</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                _SYS_vbuf_poke(&amp;sys.vbuf, addr + wTiles,</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                    _SYS_TILE77(palette ^ (<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#abfd9db57c562b2e8056ad70ff03468efa89635bc9e1e5e10497369c80468c1998" title="First tile in the horizontal bargraph series.">H_BARGRAPH</a> + wRemainder - 1)));</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;            addr += <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>();</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        }</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    }</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div>
<div class="line"><a name="l00262"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a6bbff31aae7aa5d5a0f23a36aa058edc">  262</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a6bbff31aae7aa5d5a0f23a36aa058edc" title="Draw text, using the builtin ROM font, starting at location &#39;topLeft&#39; in tiles.">text</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> topLeft, <span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keyword">enum</span> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ada13ca0ac5108834ce02bd3956e956d4" title="Palette IDs, XOR&#39;ed with the tile IDs below.">Palette</a> palette = BLACK)</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    {</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordtype">unsigned</span> addr = <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a81a49c8fbb2215fb19833c2d0a477fea" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(topLeft);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        <span class="keywordtype">unsigned</span> lineAddr = addr;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        <span class="keywordtype">char</span> c;</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        <span class="keywordflow">while</span> ((c = *str)) {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;            <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;\n&#39;</span>)</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;                addr = (lineAddr += <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#ac7ad8fdbfc64918587a226b780d05874" title="Return the width, in tiles, of this mode.">tileWidth</a>());</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;                _SYS_vbuf_poke(&amp;sys.vbuf, addr++, _SYS_TILE77(<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a0d3e6d2ad6fff5d0876d7d3a03f4887f" title="Calculate the tile index of one character in the ROM font.">charTile</a>(c, palette)));</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;            str++;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        }</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    }</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a26cb40d8042af7763264dd36f8987be6">  280</a></span>&#160;    _SYSVideoBuffer &amp;<a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a26cb40d8042af7763264dd36f8987be6" title="Return the VideoBuffer associated with this drawable.">videoBuffer</a>() {</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        <span class="keywordflow">return</span> sys.vbuf;</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    }</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div>
<div class="line"><a name="l00287"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1de09880974da8b3abc7be5f5a886ccf">  287</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html#a1de09880974da8b3abc7be5f5a886ccf" title="Return the CubeID associated with this drawable.">cube</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    }</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;};</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;};  <span class="comment">// namespace Sifteo</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
